<?php
$params = array_merge(
    require(__DIR__ . '/../../../common/config/params.php'),
    //require(__DIR__ . '/../../common/config/params-local.php'),
    require(__DIR__ . '/params.php')
    //require(__DIR__ . '/params-local.php')
);

return [
    'id' => 'app-psite',
    'defaultRoute'=>"main",
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'controllerNamespace' => 'app_admin\controllers',
    'components' => [
        'request' => [
            'csrfParam' => '_csrf-frontend',
            'cookieValidationKey' => 'oiiu',
            'enableCsrfValidation'=>false,

        ],
        'user' => [
            'identityClass' => 'common\models\User',
            'enableAutoLogin' => true,
            'identityCookie' => ['name' => '_identity-frontend', 'httpOnly' => true],
        ],
        'session' => [
            // this is the name of the session cookie used for login on the frontend
            'name' => 'advanced-frontend',
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                    'logFile'=>'../runtime/logs/'.date('Ymd',time()).'/'.date('H.i',time()).'.log'
                ],
            ],
        ],
        'errorHandler' => [
            'errorAction' => 'error/index',
        ],
        'urlManager' => [
            'enablePrettyUrl' => true,//开启URL美化
            'showScriptName' => false,//禁用index.php文件
            'rules' => [
                '/test/<id:\d+>'=>'main/test',
                '/os/abc'=>'os/list'
                 //'<controller:\w+><action:\w+>'=>'<controller><action>',
               // '/scan'=>'scan/index',
                //'scan/login/<key:\w+>' => 'scan/login',//设置自己的路由规则，这里我设置了一个控制器里面的一个方法的规则,只要满足了这个规则就会跳转到相应的方法去处理
                //'/'=>'main/tes'
            ]
        ],
    ],
    'params' => $params,
];
